﻿using Sunny.UI;

namespace CoreShop.App
{
    public partial class FDishPinterSetup : UIForm
    {
        public FDishPinterSetup()
        {
            InitializeComponent();
            uiTreeView1.ExpandAll();
        }

        private void uiButton1_Click(object sender, System.EventArgs e)
        {
            uiButton1.Selected = false;
            uiButton2.Selected = false;
            uiButton3.Selected = false;
            UIButton btn = (UIButton)sender;
            btn.Selected = true;
        }

        private void FDishPinterSetup_Shown(object sender, System.EventArgs e)
        {
            uiFlowLayoutPanel2.Clear();
            for (int i = 0; i < 20; i++)
            {
                DishPinterSetupItemInfo info = new DishPinterSetupItemInfo();
                info.Name = "桂花脆皮鸭" + i;
                info.Categorization = "桂气招牌";
                info.Code = "2292264115";
                info.Print = "打印";
                if (i.Mod(3) == 0)
                {
                    info.Department = "烧腊,地哩部,配置01";
                }
                else
                {
                    info.Department = "中厨,地哩部";
                }

                info.Operation = "查看记录";

                //UIDishPinterSetupItem item = new UIDishPinterSetupItem(info);
                //uiFlowLayoutPanel2.Add(item);
            }
        }

        private void uifDishPinterSetupItemHeader1_CheckBoxChecked(object sender, System.EventArgs e)
        {
            var items = uiFlowLayoutPanel2.GetControls<UIDishPinterSetupItem>(true);
            foreach (var item in items)
            {
                item.Checked = uifDishPinterSetupItemHeader1.Checked;
            }
        }
    }
}
